package operation;

import book.Book;
import book.BookList;

/**
 * Created by cc
 * Description:
 * User: CZH
 * Date: 2022-09-23
 * Time: 21:23
 */
public class DisplayOperation implements IOPeration {
    @Override
    public void work(BookList bookList) {
        if (bookList.getUsedSize() == 0){
            System.out.println("目前系统没有图书");
            return;
        }
        System.out.println("打印所有图书~");
        int size = bookList.getUsedSize();
        for (int i = 0; i < size; i++) {
            Book book = bookList.getPos(i);
            System.out.println(book);
        }
    }
}
